package com.lhb.beanLifecycle;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.*;

/**
 * @Program: spring
 * @Description:
 * @Author: LHB
 * @Version: v0.0.1
 * @Time: 2021-08-12 17:59
 **/
public class SpringBeanLifecycle implements BeanNameAware, BeanClassLoaderAware, BeanFactoryAware, InitializingBean, DisposableBean {

	public SpringBeanLifecycle() {
		System.out.println("==> SpringBeanLifecycle构造方法");
	}

	@Override
	public void setBeanClassLoader(ClassLoader classLoader) {
		System.out.println("==> setBeanClassLoader: " + classLoader);
	}

	@Override
	public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
		System.out.println("==> setBeanFactory: " + beanFactory);
	}

	@Override
	public void setBeanName(String name) {
		System.out.println("==> setBeanName: " + name);
	}

	@Override
	public void destroy() throws Exception {
		System.out.println("==> destroy");
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println("==> afterPropertiesSet");
	}

	public void initMethod() {
		System.out.println("==> initMethod");
	}

	public void destroyMethod() {
		System.out.println("==> destroyMethod");
	}
}
